Ext.app.ModuleToolbar = Ext.extend(Ext.Toolbar, {
			popIsSymbols : false,
			constructor:function(config,permissionObj){
				if(permissionObj&&permissionObj.permission&&Ext.isNumber(permissionObj.permission)){
					this.permission=permissionObj.permission;
				}
				Ext.app.ModuleToolbar.superclass.constructor.call(this,config);
				//this.constructor.prototype=Ext.WindowGroupUec3.superclass.constructor.call();
			},
			add : function(comp) {
				this.initItems();
				var args = arguments.length > 1;
				if (args || Ext.isArray(comp)) {
					var result = [];
					Ext.each(args ? arguments : comp, function(c) {
								var t = this.add(c);
								if (t) {
									result.push(t);
								} else if (this.popIsSymbols) {
									this.items.remove(result.pop());
								}
							}, this);
					return result;
				}

				var c = this.lookupComponent(this.applyDefaults(comp));
				if (c) {
					var index = this.items.length;
					if (this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false) {
						this.items.add(c);
						// *onAdded
						c.onAdded(this, index);
						this.onAdd(c);
						this.fireEvent('add', this, c, index);
					}
				}
				return c;
			},

			lookupComponent : function(c) {
				if (Ext.isString(c)) {
					if (c == '-') {
						c = new Ext.Toolbar.Separator();
					} else if (c == ' ') {
						c = new T.Spacer();
					} else if (c == '->') {
						c = new Ext.Toolbar.Fill();
					} else {
						c = new Ext.Toolbar.TextItem(c);
					}
					this.popIsSymbols = true;
					this.applyDefaults(c);
				} else {
					var permission=c.permission||this.permission;
					if (permission && Ext.CUR_APP) {
						var p = permission;
						if(Ext.isFunction(p)){
							if(!p()){
								return null;
							}
						}else{
						if(!Ext.CUR_APP.hasPermission(p)){
							return null;
							}
						}
					}
					if (c.isFormField || c.render) { // some kind of form
						// field, some kind of
						// Toolbar.Item
						c = this.createComponent(c);
					} else if (c.tag) { // DomHelper spec
						c = new Ext.Toolbar.Item({
									autoEl : c
								});
					} else if (c.tagName) { // element
						c = new Ext.Toolbar.Item({
									el : c
								});
					} else if (Ext.isObject(c)) { // must be button config?
						c = c.xtype ? this.createComponent(c) : this.constructButton(c);
					}
					this.popIsSymbols = false;
				}
				return c;
			}
		});